<!--Begin Menu-->
<div id="menu" class="ddsmoothmenu">
	<ul class="top">
		<li class="top" id="menu_li_1">
			<a href="<?= base_url() ?>" class="home<?= $is_home ? ' active' : '' ?>">
				<img src="<?= base_url() ?>styles/sunrise/images/home.png" width="20px" /></a>
		</li>
		<li class="top" id="menu_li_2">
			<a href="<?=url_create('site','forum')?>" class="top"><span><?=lang('Forum')?></span></a>
		</li>
		<? foreach ($catalogues as $cat) { ?>
			<?
			if ($cat->type != 2)
				$cat->link = url_create('site', 'ViewCatalogue', 'index', $cat->id, $cat->name);
			$active = (isset($catalogue) && $catalogue->id == $cat->id) || $this->uri->uri_string() == $cat->link;
			?>
			<li class="top" id="menu_li_2" >
				<a class="top <?= $active ? ' active' : ''; ?>" href="<?= $cat->link ?>">
					<span><?= $cat->name ?></span>
				</a>
				<? if (count($cat->children) > 0) { ?>
					<!--Begin SubMenu-->
					<ul>
						<? foreach ($cat->children as $sub1cat) { ?>
							<?
							if ($sub1cat->type != 2)
								$sub1cat->link = url_create('site', 'ViewCatalogue', 'index', $sub1cat->id, $sub1cat->name);
							?>
							<li>
								<a  href="<?= $sub1cat->link ?>" >&nbsp;<?= $sub1cat->name ?></a>
								<!--								<ul>
																</ul>-->
							</li>
						<? } ?>
					</ul>
					<!--End SubMenu-->
				<? } ?>
			</li>
		<? } ?>
		<? if ($isLogin) { ?>

			<li class="top">
				<a class="top" href="#">
					<span><?= lang('Hello %s', $user->fullname) ?></span>
				</a>
				<ul>
					<? if ($isAdmin) { ?>
						<li>
							<a href="<?= url_create('admin', 'dashboard', 'index') ?>">
								<?= lang('dashboard') ?>
							</a>
						</li>
					<? } ?>
					<li>
						<a href="<?= url_create('site', 'account', 'info') ?>"><?= lang('Info') ?></a>
					</li>
					<li>
						<a href="<?= url_create('site', 'account', 'logout') ?>"><?= lang('Log out') ?></a>
					</li>
				</ul>
			</li>
		<? } else { ?>

			<li class="top">
				<a class="top" href="<?= url_create('site', 'account', 'login') ?>">
					<span><?= lang('login') ?></span>
				</a>
			</li>
			<li class="top">
				<a class="top" href="<?= url_create('site', 'account', 'register') ?>">
					<span><?= lang('Register') ?></span>
				</a>
			</li>
		<? } ?>
	</ul>
	<div class="clear">
	</div>
</div>
<!--End Menu-->